local hx__shouxing = fk.CreateSkill {
  name = "hx__shouxing",
  tags = { Skill.Compulsory },
}

hx__shouxing:addEffect(fk.GameStart, {
  anim_type = "negative",
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(hx__shouxing.name)
  end,
  on_use = function(self, event, target, player, data)
    player.room:addPlayerMark(player, "@@hx__shouxing",1)
  end,
})

hx__shouxing:addEffect("targetmod", {
  residue_func = function(self, player, skill, scope, card)
      if skill.trueName == "slash_skill" and player:hasSkill(hx__shouxing.name) then
        return -player:getMark("@@hx__shouxing")
      end
  end,
})

hx__shouxing:addEffect(fk.DamageInflicted, {
  anim_type = "special",
  can_trigger = function (self, event, target, player, data)
    return data.to == player and player:hasSkill(hx__shouxing.name)
  end,
  on_use = function(self, event, target, player, data)
    player.room:loseHp(data.to, data.damage, hx__shouxing.name)
    data:preventDamage()
  end,
})

hx__shouxing:addEffect(fk.PreHpLost, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return data.who == player and player:hasSkill(hx__shouxing.name)
  end,
  trigger_times = function(self, event, target, player, data)
    return data.num
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(2, hx__shouxing.name)
  end,
})

hx__shouxing:addLoseEffect(function (self, player, is_death)
  player.room:setPlayerMark(player, "@@hx__shouxing", 0)
end)

return hx__shouxing